package com.zyw.module.console.user.vo;

import com.zyw.module.console.user.po.User;

import java.util.Date;

/**
 * @author zhangyw
 * @version 2017/6/29 12:01
 */
public class UserListVo {

    private int id;
    private String username;
    private String nickname;
    private String email;
    private String department;
    private String groups; // 管理账户群组（admin:管理员;user :普通用户,管理员拥有系统管理的权限, 多个逗号分隔）
    private Date createTime;
    private int status;
    private String role;

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getNickname() {
        return nickname;
    }

    public void setNickname(String nickname) {
        this.nickname = nickname;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String getDepartment() {
        return department;
    }

    public void setDepartment(String department) {
        this.department = department;
    }

    public String getGroups() {
        return groups;
    }

    public void setGroups(String groups) {
        this.groups = groups;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public int getStatus() {
        return status;
    }

    public void setStatus(int status) {
        this.status = status;
    }

    public String getRole() {
        return role;
    }

    public void setRole(String role) {
        this.role = role;
    }

    public static UserListVo toVo(User po){
        UserListVo vo = new UserListVo();
        if (po != null){
            vo.setId(po.getId());
            vo.setUsername(po.getUsername());
            vo.setNickname(po.getNickname());
            vo.setEmail(po.getEmail());
            vo.setCreateTime(po.getCreateTime());
            vo.setStatus(po.getStatus());
        }
        return vo;
    }


}
